// src/router/index.ts
import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import ProductView from '@/views/product/ProductView.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
      children: [
        {
          path: '/products',
          name: 'products',
          component: ProductView
        },
      ]
    },
    {
      path: '/login',
      name: 'login',
      // 登录页面路由
      component: () => import('../views/LoginView.vue'),
    },
  ],
})

export default router
